
pub fn custom_sort_string(order: String, s: String) -> String {
    let mut dd = Vec::<u8>::with_capacity(26);
    order.chars().for_each(|c |{
       dd.push(c as u8 - 'a' as u8);
    });
    let mut ss = Vec::<u8>::with_capacity(s.len());
    s.chars().for_each(|c|{
        ss.push(c as u8 - 'a' as u8);
    });

    ss.sort_by(|a, b| b.cmp(a));

    String::from_utf8(ss).unwrap()
}


#[cfg(test)]
mod test{
    use super::custom_sort_string;

    #[test]
    fn custom_sort_string_test(){
        let  order = "kqep".to_string();
        let  s = "pekeq".to_string();
        custom_sort_string(order,s);
    }
}